<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script src="./js/echarts/echarts.5.0.0.js"></script>
    <script src="./js/echarts/theme/shine.js"></script>
    <title>ECharts多个刻度案例</title>
  </head>
  <style>
    #chart {
      width: 800px;
      height: 400px;
      display: inline-block;
    }
  </style>
  <body>
    <div id="chart"></div>
  </body>
  <script>
    echarts.init(document.getElementById("chart")).setOption({
      title: {
        text: "ECharts多个刻度案例",
      },
      xAxis: {
        data: ["2012", "2013", "2014", "2015"],
      },
      // 多个y轴
      yAxis: [
        {},
        {
          // 隐藏刻度
          splitLine: {
            show: true,
          },
        },
      ],
      series: [
        {
          type: "bar",
          yAxisIndex: 0, // 选择y轴1
          data: [41.1, 30.4, 65.1, 53.3],
        },
        {
          type: "line",
          data: [86.5, 92.1, 85.7, 183.1],
          yAxisIndex: 1, // 选择y轴2
        },
      ],
    });
  </script>
</html>
